var express = require('express');
var router = express.Router();
var dataCtrl=require('../controllers/cate.controller');

function verifyToken(req,res,next){
	const beaerHeader =req.header['authorization'];
	if(typeof beaerHeader !=='undefined'){
		const bearer =beaerHeader.split(' ');
		const bearerToken=bearer[1];
		req.token=bearerToken;
		next();
	}else{
		res.sendStatus(403);
	}
}

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

router.post('/data', dataCtrl.create);
router.get('/data/:id', dataCtrl.getData);
router.put('/data/:id', dataCtrl.update);
router.post('/list/:type', dataCtrl.list);
router.delete('/data/:id', dataCtrl.remove);
router.post('/removemore/:id', dataCtrl.removemore);
router.get('/classlist/:type', dataCtrl.classList);
//router.post('/getbyparent/:parentId',dataCtrl.getDataByparentId);

module.exports = router;
